GH-113710: Fix updating of dict version tag and add watched dict stats#115221
Merged
markshannon merged 8 commits intopython:mainfrom Feb 12, 2024
Merged
GH-113710: Fix updating of dict version tag and add watched dict stats#115221markshannon merged 8 commits intopython:mainfrom
markshannon merged 8 commits intopython:mainfrom
Conversation
Closed
mdboom
approved these changes
Feb 9, 2024
mdboom
reviewed
Feb 9, 2024
| uint64_t func_modification; | ||
| /* Modifying a dict that is being watched */ | ||
| uint64_t watched_dict_modification; | ||
| uint64_t watched_globals_modification; |
Contributor
There was a problem hiding this comment.
How do these new stats relate to the existing builtin_dict one?
Member
Author
There was a problem hiding this comment.
They only apply to any watched dict, and watched module globals respectively.
Whereas the builtin dict count tracks any modification to the builtins, which are always watched
In theory watched_globals_modification + builtin_dict == watched_dict_modification
Although, as soon as we start watching any other dicts that will no longer be true.
Member
Author
|
The stats look good ~800 dict watchers fired instead of 8 million. |
gvanrossum
approved these changes
Feb 10, 2024
Member
gvanrossum
left a comment
There was a problem hiding this comment.
So I take it PyDict_EVENT_CLONED is no longer special?
Member
Author
It never was, it was (and still is) misnamed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a regression introduced by #114592 where mutating a global variable would cause repeated de-optimizations.